package cn.iune.erp.customer;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.sql.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;

import com.justep.baas.data.RowState;

//客户商品价格
@Entity
@Table(name="CustomerItem",uniqueConstraints={@UniqueConstraint(columnNames={"customerID", "itemID"})})
@NamedQuery(name="CustomerItem.findAll", query="SELECT s FROM CustomerItem s")
public class CustomerItem {

	public CustomerItem() {

	}
	
	@Id
	@Column(length=36)
	private String fID;
	
	private Date orderDate;
	@Column(length=10)
	private String state;
	@Column(length=10)
	private String status;

	@Column(length=32)
	private String customerID;
	@Column(length=32)
	private String itemID;
	
//	private int upperShelf = 0;//上架
	
	@Transient
	@Column(length=20,columnDefinition="VARCHAR(20) default '********************' COMMENT '批号'")
	private String batchNo;
	
	////////////////////////////////////物料档案临时数据////////////////////
	@Transient
	@Column(length=32)
	private String fParent;
	@Transient
	private int configType = 0;//可配置物料
	
	@Transient
	@Column(length=30)
	private String itemNo;
	@Transient
	private String itemDescribe;
	@Transient
	@Column(length=512)
	private String itemProperty;
	@Transient
	@Column(length=100)
	private String itemName;
	@Transient
	@Column(length=20)
	private String unitName;
	
	@Transient
	@Column(length=1)
	private String process;
	@Transient
	@Column(length=10)
	private String processLabel;

	@Transient
	@Column(length=1)
	private String forSale;
	@Transient
	@Column(length=1)
	private String forUsed;
	
	@Transient
	private int qualityType = 0;
	@Transient
	@Column(length=10)
	private String qualityTypeLabel = "0:免检,1:抽检,2:全检";
	@Transient
	private int qualityPeriod = 0;//0,不启用保质期管理；1，启用
	@Transient
	private int validDays = 0;
	@Transient
	private int checkoutAgainDays = 0;
	@Transient
	@Column(length=20)
	private String storeNo;
	
	@Transient
	@Column(precision=10,scale=2,columnDefinition="DECIMAL(10,2) default 0",nullable=false)
	private BigDecimal taxRate = BigDecimal.ZERO;
	
	@Transient
	private int saleTaxType = 1;
	@Transient
	@Column(precision=38,scale=6,columnDefinition="DECIMAL(38,6) default 0",nullable=false)
	private BigDecimal salePrice = BigDecimal.ZERO;

	@Transient
	@Column(precision=10,scale=2)
	private BigDecimal itemWeight = BigDecimal.ZERO;
	@Transient
	@Column(length=20)
	private String itemSize;
	
	@Transient
	@Column(precision=10,scale=2)
	private BigDecimal orderWeight = BigDecimal.ZERO;
	@Transient
	@Column(length=20)
	private String orderSize;
	
	@Transient
	@Column(length=256)
	private String imageurl;
	
	@Transient
	@Column(length=1024)
	private String images;
	
	@Transient
	@Column(length=30)
	private String barcode;
	
	//////////////////////////////////////////////////////////////////
	
	////////////////////////////////////档案临时数据////////////////////

	@Transient
	@Column(length=3)
	private String storageTypeD;
	@Transient
	@Column(length=20)
	private String storageTypeDLabel;
	
	@Transient
	@Column(length=15)
	private String customerNo;//客户编号
	@Transient
	@Column(length=20)
	private String shortName;
	@Transient
	@Column(length=128)
	private String customerName;
	
	@Transient
	private int isMember = 0;
	@Transient
	@Column(length=20)
	private String memberNo;//会员卡号

	//////////////////////////////////////////////////////////////////
	
	private Date dealDateFirst;
	private Date dealDateLast;
	
	@Column(precision=38,scale=6,columnDefinition="DECIMAL(38,6) default 0",nullable=false)
	private BigDecimal custPrice = BigDecimal.ZERO;
//	@Column(precision=10,scale=2)
//	private BigDecimal discountRate = BigDecimal.ZERO;
	
	private Date predictStart;//生效日
	private Date predictEnd;//失效日
	
	@Column(length=15)
	private String cUsercode;
	@Column(length=20)
	private String cUsername;//制单人
	private Timestamp cDatetime;
	@Column(length=15)
	private String tUsercode;
	@Column(length=20)
	private String tUsername;//审核人
	private Timestamp tDatetime;
	@Column(length=15)
	private String eUsercode;
	@Column(length=20)
	private String eUsername;//关单人
	private Timestamp eDatetime;
	
	@Column(length=65)
	private String userId;

	@Column(length=128)
	private String enterpriseNo;
	@Column(length=128)
	private String enterpriseName;

	@Version
//	private int version = 0;
	private long version;
	
	@Transient//非持久字段
	private RowState rowState;
	public RowState getRowState() {
		return rowState;
	}
	public void setRowState(RowState rowState) {
		this.rowState = rowState;
	}
	public long getVersion() {
		return version;
	}
	public void setVersion(long version) {
		this.version = version;
	}
	public String getfID() {
		return fID;
	}
	public void setfID(String fID) {
		this.fID = fID;
	}
	public String getCustomerID() {
		return customerID;
	}
	public void setCustomerID(String customerID) {
		this.customerID = customerID;
	}
	public String getItemID() {
		return itemID;
	}
	public void setItemID(String itemID) {
		this.itemID = itemID;
	}
	public String getBatchNo() {
		return batchNo;
	}
	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}
	public String getfParent() {
		return fParent;
	}
	public void setfParent(String fParent) {
		this.fParent = fParent;
	}
	public int getConfigType() {
		return configType;
	}
	public void setConfigType(int configType) {
		this.configType = configType;
	}
	public String getItemNo() {
		return itemNo;
	}
	public void setItemNo(String itemNo) {
		this.itemNo = itemNo;
	}
	public String getItemDescribe() {
		return itemDescribe;
	}
	public void setItemDescribe(String itemDescribe) {
		this.itemDescribe = itemDescribe;
	}
	public String getItemProperty() {
		return itemProperty;
	}
	public void setItemProperty(String itemProperty) {
		this.itemProperty = itemProperty;
	}
	public String getItemName() {
		return itemName;
	}
	public void setItemName(String itemName) {
		this.itemName = itemName;
	}
	public String getUnitName() {
		return unitName;
	}
	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}
	public String getProcess() {
		return process;
	}
	public void setProcess(String process) {
		this.process = process;
	}
	public String getProcessLabel() {
		return processLabel;
	}
	public void setProcessLabel(String processLabel) {
		this.processLabel = processLabel;
	}
	public String getForSale() {
		return forSale;
	}
	public void setForSale(String forSale) {
		this.forSale = forSale;
	}
	public String getForUsed() {
		return forUsed;
	}
	public void setForUsed(String forUsed) {
		this.forUsed = forUsed;
	}
	public int getQualityType() {
		return qualityType;
	}
	public void setQualityType(int qualityType) {
		this.qualityType = qualityType;
	}
	public String getQualityTypeLabel() {
		return qualityTypeLabel;
	}
	public void setQualityTypeLabel(String qualityTypeLabel) {
		this.qualityTypeLabel = qualityTypeLabel;
	}
	public int getQualityPeriod() {
		return qualityPeriod;
	}
	public void setQualityPeriod(int qualityPeriod) {
		this.qualityPeriod = qualityPeriod;
	}
	public int getValidDays() {
		return validDays;
	}
	public void setValidDays(int validDays) {
		this.validDays = validDays;
	}
	public int getCheckoutAgainDays() {
		return checkoutAgainDays;
	}
	public void setCheckoutAgainDays(int checkoutAgainDays) {
		this.checkoutAgainDays = checkoutAgainDays;
	}
	public String getStoreNo() {
		return storeNo;
	}
	public void setStoreNo(String storeNo) {
		this.storeNo = storeNo;
	}
	public BigDecimal getTaxRate() {
		return taxRate;
	}
	public void setTaxRate(BigDecimal taxRate) {
		this.taxRate = taxRate;
	}
	public BigDecimal getItemWeight() {
		return itemWeight;
	}
	public void setItemWeight(BigDecimal itemWeight) {
		this.itemWeight = itemWeight;
	}
	public String getItemSize() {
		return itemSize;
	}
	public void setItemSize(String itemSize) {
		this.itemSize = itemSize;
	}
	public BigDecimal getOrderWeight() {
		return orderWeight;
	}
	public void setOrderWeight(BigDecimal orderWeight) {
		this.orderWeight = orderWeight;
	}
	public String getOrderSize() {
		return orderSize;
	}
	public void setOrderSize(String orderSize) {
		this.orderSize = orderSize;
	}
	public String getImageurl() {
		return imageurl;
	}
	public void setImageurl(String imageurl) {
		this.imageurl = imageurl;
	}
	public String getImages() {
		return images;
	}
	public void setImages(String images) {
		this.images = images;
	}
	public String getBarcode() {
		return barcode;
	}
	public void setBarcode(String barcode) {
		this.barcode = barcode;
	}
	public String getStorageTypeD() {
		return storageTypeD;
	}
	public void setStorageTypeD(String storageTypeD) {
		this.storageTypeD = storageTypeD;
	}
	public String getStorageTypeDLabel() {
		return storageTypeDLabel;
	}
	public void setStorageTypeDLabel(String storageTypeDLabel) {
		this.storageTypeDLabel = storageTypeDLabel;
	}
	public String getCustomerNo() {
		return customerNo;
	}
	public void setCustomerNo(String customerNo) {
		this.customerNo = customerNo;
	}
	public String getShortName() {
		return shortName;
	}
	public void setShortName(String shortName) {
		this.shortName = shortName;
	}
	public String getCustomerName() {
		return customerName;
	}
	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}
	public Date getDealDateFirst() {
		return dealDateFirst;
	}
	public void setDealDateFirst(Date dealDateFirst) {
		this.dealDateFirst = dealDateFirst;
	}
	public Date getDealDateLast() {
		return dealDateLast;
	}
	public void setDealDateLast(Date dealDateLast) {
		this.dealDateLast = dealDateLast;
	}
	public BigDecimal getSalePrice() {
		return salePrice;
	}
	public void setSalePrice(BigDecimal salePrice) {
		this.salePrice = salePrice;
	}
	public Date getPredictStart() {
		return predictStart;
	}
	public void setPredictStart(Date predictStart) {
		this.predictStart = predictStart;
	}
	public Date getPredictEnd() {
		return predictEnd;
	}
	public void setPredictEnd(Date predictEnd) {
		this.predictEnd = predictEnd;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getEnterpriseNo() {
		return enterpriseNo;
	}
	public void setEnterpriseNo(String enterpriseNo) {
		this.enterpriseNo = enterpriseNo;
	}
	public String getEnterpriseName() {
		return enterpriseName;
	}
	public void setEnterpriseName(String enterpriseName) {
		this.enterpriseName = enterpriseName;
	}
	public BigDecimal getCustPrice() {
		return custPrice;
	}
	public void setCustPrice(BigDecimal custPrice) {
		this.custPrice = custPrice;
	}
	public Date getOrderDate() {
		return orderDate;
	}
	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public int getIsMember() {
		return isMember;
	}
	public void setIsMember(int isMember) {
		this.isMember = isMember;
	}
	public String getMemberNo() {
		return memberNo;
	}
	public void setMemberNo(String memberNo) {
		this.memberNo = memberNo;
	}
	public String getcUsercode() {
		return cUsercode;
	}
	public void setcUsercode(String cUsercode) {
		this.cUsercode = cUsercode;
	}
	public String getcUsername() {
		return cUsername;
	}
	public void setcUsername(String cUsername) {
		this.cUsername = cUsername;
	}
	public Timestamp getcDatetime() {
		return cDatetime;
	}
	public void setcDatetime(Timestamp cDatetime) {
		this.cDatetime = cDatetime;
	}
	public String gettUsercode() {
		return tUsercode;
	}
	public void settUsercode(String tUsercode) {
		this.tUsercode = tUsercode;
	}
	public String gettUsername() {
		return tUsername;
	}
	public void settUsername(String tUsername) {
		this.tUsername = tUsername;
	}
	public Timestamp gettDatetime() {
		return tDatetime;
	}
	public void settDatetime(Timestamp tDatetime) {
		this.tDatetime = tDatetime;
	}
	public String geteUsercode() {
		return eUsercode;
	}
	public void seteUsercode(String eUsercode) {
		this.eUsercode = eUsercode;
	}
	public String geteUsername() {
		return eUsername;
	}
	public void seteUsername(String eUsername) {
		this.eUsername = eUsername;
	}
	public Timestamp geteDatetime() {
		return eDatetime;
	}
	public void seteDatetime(Timestamp eDatetime) {
		this.eDatetime = eDatetime;
	}



}